import request from "@/utils/request";

const baseUrl = "systemMenu/";

/**
 * 获取所有菜单
 * @param pagination
 * @param keyword
 * @returns {AxiosInstance}
 */
export function page(pagination, keyword) {
    return new request({
        url: `${baseUrl}list`,
        method: "GET",
        params: {...pagination, ...keyword}
    })
}

/**
 * 获取所有权限菜单
 */
export function menuChildren() {
    return new request({
        url: `${baseUrl}children/list`,
        method: "GET"
    })
}

/**
 * 修改菜单信息
 * @param menu
 * @returns {AxiosInstance}
 */
export function updateMenu(menu) {
    return new request({
        url: `${baseUrl}`,
        method: "PUT",
        data: menu
    })
}